package br.com.cadele.service;

import java.io.Serializable;
import java.util.ArrayList;

import br.com.cadele.dao.ProfessorDAO;
import br.com.cadele.model.Professor;

public class ProfessorService implements Serializable{

	private static final long serialVersionUID = -3936867722004448984L;
	private ProfessorDAO professoDAO;
	
	public ProfessorService() {
		professoDAO = new ProfessorDAO();
	}
	
	public ArrayList<Professor> getAll(){
		return professoDAO.executeQuery("SELECT * FROM Professor");
	}

	public void executeInsert(Professor professor){
		StringBuilder query = new StringBuilder();
		query.append("INSERT INTO professor VALUES ('");
		query.append(professor.getSiape()+"','");
		query.append(professor.getCodigoDepartamento()+"','");
		query.append(professor.getEndereco()+"','");
		query.append(professor.getEmail()+"','");
		query.append(professor.getNome()+"','");
		query.append(professor.getCpf()+"','");
		query.append(professor.getTelefone()+"')");
		professoDAO.executeSQL(query.toString());
	}
	public void executeUpdate(Professor professor, long id){
		//TODO
		professoDAO.executeQuery("");
	}
	
	public void executeDelete(Professor professor){
		//TODO
		professoDAO.executeQuery("");
	}
	
}
